A digital magnetic sensor employing a Hall element has been widely used in order to detect whether an apparatus is in an open state or a closed state, for example. The digital magnetic sensor can detect a magnetic field intensity corresponding to each polarity by the Hall element. Such a digital magnetic sensor is disclosed in Japanese Patent Application Publication Nos. 2003-43123 and 2000-174254.
The former Patent Application Publication discloses a magnetic sensor including a Hall element, which detects a magnetic field and converts the magnetic field into an electric signal. An output voltage from the Hall element is amplified by a voltage amplifier. The amplified signal amplified by the voltage amplifier is inputted to a voltage comparator circuit. A switch circuit, which reverses a polarity of the amplified signal, is provided between the voltage amplifier and the voltage comparator circuit. An output signal from the voltage comparator circuit is held by a latch circuit.
The voltage comparator circuit reverses the polarity of a hysteresis voltage which determines a reference value of the magnetic field intensity. For the reversing operation, the voltage comparator circuit uses a first synchronous signal serving as a trigger to detect the magnetic field, and a second synchronous signal following the first synchronous signal.
The magnetic sensor continuously performs magnetic field detection operations of the S pole and of the N pole alternately according to the first and the second synchronous signals.
The latter Patent Application Publication discloses a semiconductor integrated circuit for magnetic detection. The semiconductor integrated circuit includes a Hall element to obtain a voltage output corresponding to the magnetic field intensity. Electric power is intermittently supplied to the Hall element from a power supply circuit. The output from the Hall element is compared with a reference corresponding to a magnetic field having a predetermined intensity by a comparator circuit.
The comparator circuit outputs a signal indicating a comparison result. The output from the comparator circuit is stored in a latch circuit, and is held while the electric power supply is suspended. The semiconductor integrated circuit performs intermittently magnetic field detection operations of the S pole, and of the N pole alternately.
Each of the magnetic sensor and the semiconductor integrated circuit shown in the above-described Patent Application Publications can detect magnetism, even if the magnetic field of either the S pole or the N pole is applied to the Hall element.
Even when the magnetic field of either the S pole or the N pole is continuously applied to the Hall elements, detections of the magnetic field for the other polarity are made. Thus, useless electric power is consumed in the magnetic sensor and the semiconductor integrated circuit.
In particular, the power consumption of a mobile information terminal device such as a mobile phone has been increasing along with the advancement of higher functional mobile information terminal devices with higher performance. Such a mobile information terminal device, which consumes as little electric current as possible, is required in order to be used for a long time.